﻿
define(['app'], function(app) {
	
	app.register.service('ContentServices',function(httpServices){
		
		//正文模板
		var fodder = {};
        //获取用户信息；
		//根据指定标识查询内容
		fodder.getContent = function(_params,_successCallback, _errorCallback){
			httpServices.ajax(_params,_successCallback, _errorCallback, 'get', '/eimp/fodder/content/get');
		};
        //点赞
        fodder.praise = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params,_successCallback, _errorCallback, 'post', '/eimp/fodder/content/zan');
        };
        //用户评论点赞
        fodder.messagePraise = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params,_successCallback, _errorCallback, 'post', '/eimp/fodder/content/cmt/zan');
        };
        //内容评论回复
        fodder.comment = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params,_successCallback, _errorCallback, 'post', '/eimp/fodder/content/cmt/add', false);
        };
		//获取指定名称的图文展示组
		fodder.getGrid = function(_params,_successCallback, _errorCallback){
			httpServices.ajax(_params, _successCallback, _errorCallback, 'get', '/eimp/fodder/grid/getByName');
		};
		//查询所有图片
		fodder.listPicture = function(_params,_successCallback, _errorCallback){
			httpServices.ajax(_params, _successCallback, _errorCallback, 'get', '/eimp/fodder/picture/list');
		};
        //分页查询评论
        fodder.query = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params, _successCallback, _errorCallback, 'get', '/eimp/fodder/content/cmt/query');
        };
        //内容转发
        fodder.transmit = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params, _successCallback, _errorCallback, 'post', '/eimp/fodder/content/transmit');
        };
        //设置转发签名
        fodder.setTransmitSign = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params, _successCallback, _errorCallback, 'post', '/eimp/fodder/transmit/setTransmitSign');
        };
        //获取当前用户的转发签名
        fodder.getTransmitSign = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params, _successCallback, _errorCallback, 'get', '/eimp/fodder/transmit/getTransmitSign');
        };
        //分享内容加积分
        fodder.score = function(_params,_successCallback, _errorCallback){
        	httpServices.ajax(_params, _successCallback, _errorCallback, 'post', '/eimp/fodder/content/score');
        };
        
		return {
			fodder : fodder
		};
		
	});
	
});